package cn.razgriz.aop;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component("myAspect")
@Aspect  //标注当前MyAspect是切面
public class MyAspect {

    //配置前置增强
    @Before("MyAspect.pointcut()")
    public void before(){
        System.out.println("前置增强");
    }

    @Pointcut("execution(public void cn.razgriz.aop.Target.save())")
    //表达式抽取
    public void pointcut(){}
}
